home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
FM Towns: Free Software Collection 4
/
FM Towns Free Software Collection 4 - Disc 1.iso
/
fb386
/
superedt
/
s_map.bas
< prev
next >
Wrap
BASIC Source File
|
1991-10-18
|
29KB
|
624 lines
10000 '
10010 ' SUPER大戦略MAP-EDITOR
10020 ' BY MEET MHG02535
10030 '
10040 SCREEN@ 0:WIDTH 80,25:CONSOLE 0,24,2:COLOR 7,0,%10,0
10050 CLEAR ,,,400000:DEFINT A-Z:ON ERROR GOTO *ERR
10060 DIM LAND&(3967),HQ&(185),MAPCHECK(13),C$(3)
10070 DIM UNITNAME$(125),MASK(31,31),MAP_COLOR(25),MASK&(127)
10080 DIM MAP_DATA$(63),CAMP$(3),CAMP_UNIT$(4*48),PRODUCTION$(3)
10090 DIM MAP1&(29567),ARM_NAME$(15),UNITDATA(125,13)
10100 DEF FNMAP(X,Y)=ASC(MID$(MAP_DATA$(Y),X*2+1,1))
10110 DEF FNUNIT_TMP(X,Y)=ASC(MID$(MAP_DATA$(Y),X*2+2,1))
10120 DEF FNUNIT(X,Y)=FNUNIT_TMP(X,Y) MOD 64+(FNUNIT_TMP(X,Y)\64)*48
10130 DEF FNUNIT_NO(X,Y)=ASC(MID$(CAMP_UNIT$(FNUNIT(X,Y)),3,1))-1
10140 DEF FNUNIT_NO1(NO)=ASC(MID$(CAMP_UNIT$(NO),3,1))-1
10150 DEF FNUNIT_LEFT(X,Y)=ASC(MID$(CAMP_UNIT$(FNUNIT(X,Y)),4,1))
10160 DEF FNUNIT_DATA$(I,J,K)=MID$(CAMP_UNIT$(I),J,K)
10180 GOSUB *LOAD
10185 GOSUB *PALETTE
10190 GOSUB *LOAD_DATA
10200 GOSUB *MASK
10210 GOSUB *SET_HEX_DATA
10220 *INITIALIZE '--------------------------------------------- INITIALIZE
10230 CLS
10240 C$(0)="青":C$(1)="赤":C$(2)="緑":C$(3)="黄"
10250 UNIT_NO=0:HEX_NO=0:UNIT_S=0:CAMP=1
10260 HEX_X=0:HEX_Y=0:HEX_MODE=0 'HEX_MODE = 0&1 .. VIEW MODE 2.. HQ MODE
10270 GOSUB *PRINT_HEX_ALL:GOSUB *PRINT_HEX
10280 EDIT_MODE=0 ' 0..HEX 1..UNIT
10290 SYMBOL(0,464),"MODE HEXSIZE SAVE LOAD SITUATION MAPCHECK CLEAR BOX",1,1,%10
10300 GOSUB *PRINT_SELECTION
10310 MOUSE 0:MOUSE 1,320,240,1
10320 *MAIN '--------------------------------------------------------- MAIN
10330 ON EDIT_MODE+1 GOTO *HEX_MODE,*UNIT_MODE
10340 *HEX_MODE '------------------------------------------------- HEX_MODE
10350 WHILE MOUSE(2,0)=0:WEND
10360 MX=MOUSE(0):MY=MOUSE(1)
10370 NX=HEX_X+X:NY=HEX_Y+Y
10380 Y=(MY-HEX_SY/2-HEX_SY/8)/HEX_SY:X=(MX-HEX_SX/2+HEX_SX*(Y MOD 2=1)/2)/HEX_SX
10390 IF X<0 THEN X=0 ELSE IF X>HEX_MX LINE(543,422)-(630,438),PSET,%0,BF:GOTO 10430
10400 IF Y<0 THEN Y=0 ELSE IF Y>HEX_MY LINE(543,422)-(630,438),PSET,%0,BF:GOTO 10430
10410 IF NX<>HEX_X+X OR NY<>HEX_Y+Y LINE(543,422)-(630,438),PSET,%0,BF:SYMBOL(543,422),"X="+STR$(HEX_X+X)+" Y="+STR$(HEX_Y+Y),1,1,%10
10420 IF X<=HEX_MX AND Y<=HEX_MY GOTO *SELECT_HEX
10430 IF MY>462 GOTO *SELECT_COMMAND
10440 IF MX>574 AND MX<639 AND MY<65 AND MY>0 GOSUB *SELECT_HEX_ALL:GOTO 10350
10450 IF MX>542 AND MX<639 AND MY<358 AND MY>69 GOTO *SELECT_SELECTION
10460 GOTO 10350
10470 *SELECT_HEX '-------------------------------------------- SELECT_HEX
10480 IF X=0 AND HEX_MODE<2 IF HEX_X>0 GOTO *MOVE_HEX
10490 IF Y=0 AND HEX_MODE<2 IF HEX_Y>0 GOTO *MOVE_HEX
10500 IF X=HEX_MX AND HEX_MODE<2 IF X+HEX_X<63 GOTO *MOVE_HEX
10510 IF Y=HEX_MY AND HEX_MODE<2 IF Y+HEX_Y<63 GOTO *MOVE_HEX
10520 MID$(MAP_DATA$(Y+HEX_Y),(X+HEX_X)*2+1,1)=CHR$(HEX_NO)
10530 PSET(575+X+HEX_X,1+Y+HEX_Y),%MAP_COLOR(FNMAP(X+HEX_X,Y+HEX_Y))
10540 ON HEX_MODE+1 GOTO *HEX_MODE0,*HEX_MODE1,*HEX_MODE2
10550 *HEX_MODE0
10560 SX=X*32+(Y MOD 2)*16:SY=Y*24:X1=HEX_X+X:Y1=HEX_Y+Y
10570 PUT@A(SX,SY)-(SX+31,SY+31),LAND&,MATTE,,,0,128*FNMAP(X1,Y1)
10580 IF FNUNIT_TMP(X1,Y1)<>255 A$=UNITNAME$(FNUNIT_NO(X1,Y1)):I=INSTR(A$," "):COLOR ,%10:SYMBOL(SX,SY+16),A$,1/(-3*(I=0)-2*(I>9)-(I>5)+1),.5!,%(FNUNIT_TMP(X1,Y1)\64)+1,,,8:COLOR ,%0:SYMBOL(SX+8,SY+8),STR$(FNUNIT_LEFT(X1,Y1)),1,.5!,%10,,,8
10590 GOTO 10350
10600 *HEX_MODE1
10610 SX=X*16+(Y MOD 2)*8:SY=Y*12:X1=HEX_X+X:Y1=HEX_Y+Y
10620 PUT@A(SX,SY)-(SX+31,SY+31),LAND&,MATTE,.5!,.5!,0,128*FNMAP(X1,Y1)
10630 IF FNUNIT_TMP(X1,Y1)<>255 SYMBOL(SX,SY+8),STR$(FNUNIT_LEFT(X1,Y1)),.5!,.5!,%(FNUNIT_TMP(X1,Y1)\64)+1,,,8
10640 GOTO 10350
10650 *HEX_MODE2
10660 SX=X*8+(Y MOD 2)*4:SY=Y*6
10670 IF FNUNIT_TMP(X,Y)=255 I=FNMAP(X,Y) ELSE I=25+(FNUNIT_TMP(X,Y)\64)
10680 PUT@A(SX,SY)-(SX+7,SY+5),HQ&,MATTE,,,0,6*I
10690 GOTO 10350
10700 *MOVE_HEX '------------------------------------------------ MOVE_HEX
10710 LINE(574+HEX_X,HEX_Y)-STEP(HEX_MX+3,HEX_MY+3),XOR,%10,B
10720 HEX_X=HEX_X+X-(HEX_MX+1)/2:HEX_Y=HEX_Y+Y-(HEX_MY+1)/2
10730 HEX_X=INT(HEX_X/2)*2 :HEX_Y=INT(HEX_Y/2)*2
10740 IF HEX_X<0 HEX_X=0 ELSE IF HEX_X>63-HEX_MX HEX_X=63-HEX_MX
10750 IF HEX_Y<0 HEX_Y=0 ELSE IF HEX_Y>63-HEX_MY HEX_Y=63-HEX_MY
10760 GOSUB *PRINT_HEX
10770 GOTO 10350
10780 *SELECT_HEX_ALL '------------------------------------- SELECT_HEX_ALL
10790 IF HEX_MODE=2 RETURN
10800 X1=HEX_X:Y1=HEX_Y
10810 WHILE MOUSE(2,0)
10820 MX=MOUSE(0):MY=MOUSE(1)
10830 LINE(574+HEX_X,HEX_Y)-STEP(HEX_MX+3,HEX_MY+3),XOR,%10,B
10840 HEX_X=MX-575:HEX_Y=((MY-1)\2)*2
10850 IF HEX_X<0 HEX_X=0 ELSE IF HEX_X>63-HEX_MX HEX_X=63-HEX_MX
10860 IF HEX_Y<0 HEX_Y=0 ELSE IF HEX_Y>63-HEX_MY HEX_Y=63-HEX_MY
10870 LINE(574+HEX_X,HEX_Y)-STEP(HEX_MX+3,HEX_MY+3),XOR,%10,B
10880 WEND
10890 IF X1<>HEX_X OR Y1<>HEX_Y LINE(574+HEX_X,HEX_Y)-STEP(HEX_MX+3,HEX_MY+3),XOR,%10,B:GOSUB *PRINT_HEX
10900 RETURN
10910 *SELECT_SELECTION '--------------------------------- SELECT_SELECTION
10920 X=(MX-559)/32:Y=(MY-86)/32
10930 HEX_NO=X+Y*3
10940 IF HEX_NO>24 HEX_NO=24
10950 PUT@A(543,374)-(574,405),LAND&,,,,,128*HEX_NO
10960 GOTO 10350
10970 *SELECT_COMMAND '------------------------------------- SELECT_COMMAND
10980 X=MX/8
10990 IF X<5 GOSUB *CHANGE_MODE:GOTO 10350
11000 IF X>5 AND X<13 GOSUB *CHANGE_HEX_SIZE:GOTO 10350 '
11010 IF X>13 AND X<18 GOSUB *SAVE:GOTO 10350
11020 IF X>18 AND X<23 GOSUB *LOAD:GOTO 10350
11030 IF X>23 AND X<33 GOSUB *SITUATION:GOTO 10350 '
11040 IF X>33 AND X<42 GOSUB *MAPCHECK:GOTO 10350 '
11050 IF X>42 AND X<48 GOSUB *CLEAR:GOTO 10350 '
11060 IF X>48 AND X<52 GOSUB *BOX:GOTO 10350 '
11070 GOTO 10350
11080 *CHANGE_HEX_SIZE '----------------------------------- CHANGE_HEX_SIZE
11090 SYMBOL(5*8,464),"HEXSIZE",1,1,%1
11100 WHILE MOUSE(2,0):WEND
11110 SYMBOL(16,448),"HEX SIZE: 16*18 32*36 64*64",1,1,%10
11120 X1=HEX_MODE
11130 WHILE MOUSE(2,0)=0:WEND
11140 MX=MOUSE(0):MY=MOUSE(1)
11150 IF MX>96 AND MX<136 AND MY>447 AND MY<465 HEX_MODE=0:GOTO 11190
11160 IF MX>144 AND MX<184 AND MY>447 AND MY<465 HEX_MODE=1:GOTO 11190
11170 IF MX>192 AND MX<232 AND MY>447 AND MY<465 HEX_MODE=2:GOTO 11190
11180 GOTO 11130
11190 IF HEX_X>63-HEX_MX HEX_X=63-HEX_MX
11200 IF HEX_Y>63-HEX_MY HEX_Y=63-HEX_MY
11210 IF HEX_MODE<>X1 AND X1<2 LINE(0,0)-(527,447),PSET,%0,BF:LINE(574+HEX_X,HEX_Y)-STEP(HEX_MX+3,HEX_MY+3),XOR,%10,B:GOSUB *PRINT_HEX
11220 IF HEX_MODE<>X1 AND X1=2 LINE(0,0)-(527,447),PSET,%0,BF:GOSUB *PRINT_HEX
11230 SYMBOL(40,464),"HEXSIZE",1,1,%10
11240 LINE(16,448)-(300,463),PSET,%0,BF
11250 RETURN
11260 *CLEAR '------------------------------------------------------- CLEAR
11270 SYMBOL(42*8,464),"CLEAR",1,1,%1
11280 WHILE MOUSE(2,0):WEND
11290 SYMBOL(16,448),"MAP CLEAR: OK CANCEL",1,1,%10
11300 WHILE MOUSE(2,0)=0:WEND
11310 MX=MOUSE(0):MY=MOUSE(1)
11320 IF MX>104 AND MX<120 AND MY>447 AND MY<465 GOTO *CLEAR_OK
11330 IF MX>144 AND MX<168 AND MY>447 AND MY<465 GOTO *CLEAR_CANCEL
11340 GOTO 11300
11350 *CLEAR_OK
11360 SYMBOL(104,448),"OK",1,1,%1
11370 FOR Y=0 TO 63
11380 FOR X=0 TO 63
11390 MID$(MAP_DATA$(Y),X*2+1,1)=CHR$(HEX_NO)
11400 NEXT
11410 NEXT
11420 GOSUB *PRINT_HEX_ALL:GOSUB *PRINT_HEX
11430 *CLEAR_CANCEL
11440 SYMBOL(42*8,464),"CLEAR",1,1,%10
11450 LINE(16,448)-(200,463),PSET,%0,BF
11460 RETURN
11470 *BOX '----------------------------------------------------------- BOX
11480 SYMBOL(48*8,464),"BOX",1,1,%1
11490 WHILE MOUSE(2,0):WEND
11500 SYMBOL(16,448),"START POINT",1,1,%10
11510 WHILE MOUSE(2,0)=0 AND MOUSE(2,1)=0:WEND
11520 MX=MOUSE(0):MY=MOUSE(1):IF MOUSE(2,1) THEN *BOX_CANCEL
11530 Y=(MY-HEX_SY/2-HEX_SY/8)/HEX_SY:X=(MX-HEX_SX/2+HEX_SX*(Y MOD 2=1)/2)/HEX_SX
11540 IF Y<0 THEN Y=0
11550 IF X<0 THEN X=0
11560 IF X>HEX_MX OR Y>HEX_MY THEN 11510
11570 SX1=X:SY1=Y
11580 WHILE MOUSE(2,0):WEND
11590 SYMBOL(112,448),"X="+STR$(SX1+HEX_X)+" Y="+STR$(SY1+HEX_Y),1,1,%10
11600 SYMBOL(208,448),"END POINT",1,1,%10
11610 WHILE MOUSE(2,0)=0 AND MOUSE(2,1)=0:WEND
11620 MX=MOUSE(0):MY=MOUSE(1):IF MOUSE(2,1) THEN *BOX_CANCEL
11630 Y=(MY-HEX_SY/2-HEX_SY/8)/HEX_SY:X=(MX-HEX_SX/2+HEX_SX*(Y MOD 2=1)/2)/HEX_SX
11640 IF Y<0 THEN Y=0
11650 IF X<0 THEN X=0
11660 IF X>HEX_MX OR Y>HEX_MY THEN 11610
11670 EX1=X:EY1=Y
11680 WHILE MOUSE(2,0):WEND
11690 SYMBOL(280,448),"X="+STR$(EX1+HEX_X)+" Y="+STR$(EY1+HEX_Y),1,1,%10
11700 IF SX1>EX1 SWAP SX1,EX1
11710 IF SY1>EY1 SWAP SY1,EY1
11720 FOR Y=SY1 TO EY1
11730 FOR X=SX1 TO EX1
11740 MID$(MAP_DATA$(Y+HEX_Y),(X+HEX_X)*2+1,1)=CHR$(HEX_NO)
11750 ON HEX_MODE+1 GOTO 11760,11800,11840
11760 SX=X*32+(Y MOD 2)*16:SY=Y*24:X1=HEX_X+X:Y1=HEX_Y+Y
11770 PUT@A(SX,SY)-(SX+31,SY+31),LAND&,MATTE,,,0,128*FNMAP(X1,Y1)
11780 IF FNUNIT_TMP(X1,Y1)<>255 A$=UNITNAME$(FNUNIT_NO(X1,Y1)):I=INSTR(A$," "):COLOR ,%10:SYMBOL(SX,SY+16),A$,1/(-3*(I=0)-2*(I>9)-(I>5)+1),.5!,%(FNUNIT_TMP(X1,Y1)\64)+1,,,8:COLOR ,%0:SYMBOL(SX+8,SY+8),STR$(FNUNIT_LEFT(X1,Y1)),1,.5!,%10,,,8
11790 GOTO 11870
11800 SX=X*16+(Y MOD 2)*8:SY=Y*12:X1=HEX_X+X:Y1=HEX_Y+Y
11810 PUT@A(SX,SY)-(SX+31,SY+31),LAND&,MATTE,.5!,.5!,0,128*FNMAP(X1,Y1)
11820 IF FNUNIT_TMP(X1,Y1)<>255 SYMBOL(SX,SY+8),STR$(FNUNIT_LEFT(X1,Y1)),.5!,.5!,%(FNUNIT_TMP(X1,Y1)\64)+1,,,8
11830 GOTO 11870
11840 SX=X*8+(Y MOD 2)*4:SY=Y*6
11850 IF FNUNIT_TMP(X,Y)=255 I=FNMAP(X,Y) ELSE I=25+(FNUNIT_TMP(X,Y)\64)
11860 PUT@A(SX,SY)-(SX+7,SY+5),HQ&,MATTE,,,0,6*I
11870 NEXT
11880 NEXT
11890 LINE(16,448)-(400,463),PSET,%0,BF
11900 SYMBOL(48*8,464),"BOX",1,1,%10
11910 LINE(575+SX1+HEX_X,1+SY1+HEX_Y)-(575+EX1+HEX_X,1+EY1+HEX_Y),PSET,%MAP_COLOR(FNMAP(SX1+HEX_X,SY1+HEX_Y)),BF
11920 RETURN
11930 *MAPCHECK '------------------------------------------------- MAPCHECK
11940 SYMBOL(33*8,464),"MAPCHECK",1,1,%1
11950 WHILE MOUSE(2,0):WEND
11960 FOR I=0 TO 13:MAPCHECK(I)=0:NEXT
11970 FOR Y=0 TO 63
11980 FOR X=0 TO 63
11990 I=FNMAP(X,Y)
12000 IF I>10 MAPCHECK(I-11)=MAPCHECK(I-11)+1
12010 NEXT
12020 NEXT
12030 SYMBOL( 16,448),"青 首都:"+STR$(MAPCHECK(10))+" 都市:"+STR$(MAPCHECK(0))+" 空港:"+STR$(MAPCHECK(5)),.5!,1,%10
12040 SYMBOL(140,448),"赤 首都:"+STR$(MAPCHECK(11))+" 都市:"+STR$(MAPCHECK(1))+" 空港:"+STR$(MAPCHECK(6)),.5!,1,%10
12050 SYMBOL(264,448),"緑 首都:"+STR$(MAPCHECK(12))+" 都市:"+STR$(MAPCHECK(2))+" 空港:"+STR$(MAPCHECK(7)),.5!,1,%10
12060 SYMBOL(388,448),"黄 首都:"+STR$(MAPCHECK(13))+" 都市:"+STR$(MAPCHECK(3))+" 空港:"+STR$(MAPCHECK(8)),.5!,1,%10
12070 SYMBOL(512,448),"中立 都市:"+STR$(MAPCHECK(4))+" 空港:"+STR$(MAPCHECK(9)),.5!,1,%10
12080 WHILE MOUSE(2,0)=0:WEND
12090 SYMBOL(33*8,464),"MAPCHECK",1,1,%10
12100 WHILE MOUSE(2,0):WEND
12110 LINE(16,448)-(600,463),PSET,%0,BF
12120 RETURN
12130 *SITUATION '----------------------------------------------- SITUATION
12140 GET@A(0,0)-(527,447),MAP1&:LINE(0,0)-(527,447),PSET,%0,BF
12150 SYMBOL(0, 0),"タイトル:"+MID$(MAP_SITUATION$,11,18),1,1
12160 SYMBOL(0, 16),"コメント:"+MID$(MAP_SITUATION$,77,42),1,1
12170 SYMBOL(0, 32)," TURN:"+STR$(ASC(MID$(MAP_SITUATION$,1,1))),1,1
12180 SYMBOL(0, 48)," START:"+STR$(ASC(MID$(MAP_SITUATION$,3,1))),1,1
12190 SYMBOL(0, 64)," 相場:"+STR$(ASC(MID$(MAP_SITUATION$,8,1))),1,1
12200 FOR I=0 TO 3
12210 SYMBOL(0, 96+I*48),C$(I)+" NAME:"+MID$(CAMP$(I),1,16),1,1
12220 SYMBOL(0,112+I*48)," 収入:"+STR$(ASC(MID$(CAMP$(I),20,1))),1,1
12230 SYMBOL(0,128+I*48)," 軍資金:"+STR$( ASC(MID$(CAMP$(I),28,1))*&H1000000+ASC(MID$(CAMP$(I),27,1))*&H10000+ASC(MID$(CAMP$(I),26,1))*&H100+ASC(MID$(CAMP$(I),25,1)) ),1,1
12240 NEXT
12250 WHILE MOUSE(2,0):WEND
12260 WHILE MOUSE(2,0)=0 AND MOUSE(2,1)=0:WEND
12270 MX=MOUSE(0):MY=MOUSE(1)
12280 IF MOUSE(2,1) AND HEX_MODE<2 LINE(574+HEX_X,HEX_Y)-STEP(HEX_MX+3,HEX_MY+3),XOR,%10,B:PUT@A(0,0)-(527,447),MAP1&:RETURN
12290 IF MOUSE(2,1) AND HEX_MODE=2 PUT@A(0,0)-(527,447),MAP1&:RETURN
12300 Y=MY/16:F=0
12310 ON Y+1 GOSUB *S_TITLE,*S_COMMENT,*S_TURN,*S_START,*S_相場
12320 IF Y>5 AND Y<18 GOSUB *S_CAMP
12330 IF F=1 CLS 4:GOTO 12140
12340 GOTO 12260
12350 *S_TITLE
12360 LOCATE 0,20:LINE INPUT "タイトル:",A$:IF A$="" RETURN
12370 MID$(MAP_SITUATION$,11,18)=A$+STRING$(18," "):F=1:RETURN
12380 *S_COMMENT
12390 LOCATE 0,20:LINE INPUT "コメント:",A$:IF A$="" RETURN
12400 MID$(MAP_SITUATION$,77,42)=A$+STRING$(42," "):F=1:RETURN
12410 *S_TURN
12420 LOCATE 0,20:LINE INPUT " TURN:",A$:IF A$="" RETURN
12430 IF VAL(A$)>255 OR VAL(A$)<0 RETURN
12440 MID$(MAP_SITUATION$,1,1)=CHR$(VAL(A$)):F=1:RETURN
12450 *S_START
12460 LOCATE 0,20:LINE INPUT " START:",A$:IF A$="" RETURN
12470 IF VAL(A$)>255 OR VAL(A$)<0 RETURN
12480 MID$(MAP_SITUATION$,3,1)=CHR$(VAL(A$)):F=1:RETURN
12490 *S_相場
12500 LOCATE 0,20:LINE INPUT " 相場:",A$:IF A$="" RETURN
12510 IF VAL(A$)>255 OR VAL(A$)<0 RETURN
12520 MID$(MAP_SITUATION$,8,1)=CHR$(VAL(A$)):F=1:RETURN
12530 *S_CAMP
12540 Y=Y-6:Y1=Y\3:Y=Y-Y1*3
12550 ON Y+1 GOSUB *S_C_NAME,*S_C_収入,*S_C_MONEY
12560 IF F=1 CLS 4:GOTO 12140
12570 GOTO 12260
12580 *S_C_NAME
12590 LOCATE 0,20:PRINT C$(Y1)+" NAME:";:LINE INPUT A$:IF A$="" RETURN
12600 MID$(CAMP$(Y1),1,16)=A$+STRING$(16," "):F=1:RETURN
12610 *S_C_収入
12620 LOCATE 0,20:PRINT C$(Y1)+" 収入:";:LINE INPUT A$:IF A$="" RETURN
12630 IF VAL(A$)>255 OR VAL(A$)<0 RETURN
12640 MID$(CAMP$(Y1),20,1)=CHR$(VAL(A$)):F=1:RETURN
12650 *S_C_MONEY
12660 LOCATE 0,20:PRINT C$(Y1)+"軍資金:";:LINE INPUT A$:IF A$="" RETURN
12670 IF VAL(A$)>&H7FFFFFFF OR VAL(A$)<0 RETURN
12680 A&=VAL(A$)
12690 A=A&\&H1000000:A&=A&-A*&H1000000
12700 MID$(CAMP$(Y1),28,1)=CHR$(A)
12710 A=A&\&H10000 :A&=A&-A*&H10000
12720 MID$(CAMP$(Y1),27,1)=CHR$(A)
12730 A=A&\&H100 :A&=A&-A*&H100
12740 MID$(CAMP$(Y1),26,1)=CHR$(A)
12750 A=A&\&H1 :A&=A&-A*&H1
12760 MID$(CAMP$(Y1),25,1)=CHR$(A)
12770 F=1:RETURN
12780 *CHANGE_MODE '------------------------------------------- CHANGE_MODE
12790 SYMBOL(0,464),"MODE",1,1,%1
12800 WHILE MOUSE(2,0):WEND
12810 EDIT_MODE=(EDIT_MODE+1) AND 1
12820 GOSUB *PRINT_SELECTION
12830 SYMBOL(0,464),"MODE",1,1,%10
12840 GOTO *MAIN
12850 *UNIT_MODE '----------------------------------------------- UNIT_MODE
12860 WHILE MOUSE(2,0)=0 AND MOUSE(2,1)=0:WEND
12870 MX=MOUSE(0):MY=MOUSE(1):MB=MOUSE(2,1)
12880 NX=HEX_X+X:NY=HEX_Y+Y
12890 Y=(MY-HEX_SY/2-HEX_SY/8)/HEX_SY:X=(MX-HEX_SX/2+HEX_SX*(Y MOD 2=1)/2)/HEX_SX
12900 IF X<0 THEN X=0 ELSE IF X>HEX_MX LINE(543,422)-(630,438),PSET,%0,BF:GOTO 12950
12910 IF Y<0 THEN Y=0 ELSE IF Y>HEX_MY LINE(543,422)-(630,438),PSET,%0,BF:GOTO 12950
12920 IF NX<>HEX_X+X OR NY<>HEX_Y+Y LINE(543,422)-(630,438),PSET,%0,BF:SYMBOL(543,422),"X="+STR$(HEX_X+X)+" Y="+STR$(HEX_Y+Y),1,1,%10
12930 IF X<=HEX_MX AND Y<=HEX_MY AND MB GOTO *SELECT_HEX_U_2
12940 IF X<=HEX_MX AND Y<=HEX_MY AND MB=0 GOTO *SELECT_HEX_U
12950 IF MY>462 AND MB=0 GOTO *SELECT_COMMAND_U
12960 IF MX>574 AND MX<639 AND MY<65 AND MY>0 AND MB=0 GOSUB *SELECT_HEX_ALL:GOTO 12860
12970 IF MX>527 AND MX<639 AND MY<406 AND MY>69 AND MB=0 GOTO *SELECT_SELECTION_U
12980 GOTO 12860
12990 *SELECT_COMMAND_U '--------------------------------- SELECT_COMMAND_U
13000 X=MX/8
13010 IF X<5 GOSUB *CHANGE_MODE:GOTO 12860 '
13020 IF X>5 AND X<13 GOSUB *CHANGE_HEX_SIZE:GOTO 12860 '
13030 IF X>13 AND X<18 GOSUB *SAVE:GOTO 12860
13040 IF X>18 AND X<23 GOSUB *LOAD:GOTO 12860
13050 IF X>23 AND X<33 GOSUB *SITUATION:GOTO 12860 '
13060 IF X>33 AND X<42 GOSUB *MAPCHECK:GOTO 12860 '
13070 IF X>42 AND X<48 GOSUB *CLEAR_U:GOTO 12860
13080 GOTO 12860
13090 *SELECT_SELECTION_U '----------------------------- SELECT_SELECTION_U
13100 F=0:B=CAMP
13110 IF MX>558 AND MX<575 AND MY>84 AND MY<101 UNIT_S=UNIT_S-32:F=1
13120 IF MX>558 AND MX<575 AND MY>356 AND MY<373 UNIT_S=UNIT_S+32:F=1
13130 IF MX>527 AND MX<600 AND MY>100 AND MY<357 A=UNIT_NO:UNIT_NO=UNIT_S+(MY-105)/8:F=2
13140 IF MX>527 AND MX<600 AND MY>390 AND MY<406 CAMP=(CAMP AND 3)+1:F=2
13150 IF UNIT_S>96 UNIT_S=96:GOTO 12860 ELSE IF UNIT_S<0 UNIT_S=0:GOTO 12860
13160 IF F=1 F=0:GOSUB *PRINT_SELECTION:GOTO 12860
13170 IF F<>2 F=0:GOTO 12860
13180 IF UNIT_NO>125 UNIT_NO=A
13190 IF A=UNIT_NO AND B=CAMP THEN 12860
13200 LINE(527,389)-(639,406),PSET,%0,BF
13210 COLOR,%14:SYMBOL(528,390),UNITNAME$(UNIT_NO),.5!,1,%CAMP,,,8:COLOR,%0
13220 GOTO 12860
13230 *SELECT_HEX_U '----------------------------------------- SELECT_HEX_U
13240 X1=X+HEX_X:Y1=Y+HEX_Y
13250 IF FNUNIT_TMP(X1,Y1)=255 GOTO *PUT_UNIT
13260 *SET_DATA
13270 NO=FNUNIT_TMP(X1,Y1):NO1=FNUNIT(X1,Y1):NO2=FNUNIT_NO1(NO1)
13280 CAMP1=NO\64
13290 GET@A(528,70)-(639,405),MAP1&
13300 LINE(528,70)-(639,405),PSET,0,BF
13310 SYMBOL(528,70),"No."+RIGHT$(STR$(NO MOD 64),3),.5!,1
13320 SYMBOL(560,70),UNITNAME$(NO2),.5!,1,%CAMP1+1
13330 SYMBOL(528,86),"Move"+STR$(ASC(MID$(CAMP_UNIT$(NO1),10,1)))+"/"+STR$(UNITDATA(NO2,1)),1,1
13340 SYMBOL(528,102),"Left"+STR$(ASC(MID$(CAMP_UNIT$(NO1),4,1))),1,1
13350 SYMBOL(528,118),"Fuel"+STR$(ASC(MID$(CAMP_UNIT$(NO1),5,1)))+"/"+STR$(UNITDATA(NO2,0)),1,1
13360 FOR I=0 TO 2
13370 SYMBOL(528,134+I*32),ARM_NAME$(UNITDATA(NO2,2+I)),1,1
13380 SYMBOL(584,150+I*32),RIGHT$(" "+STR$(ASC(MID$(CAMP_UNIT$(NO1),12+I,1))),3)+"/"+RIGHT$(" "+STR$(UNITDATA(NO2,8+I)),3),1,1
13390 NEXT
13400 SYMBOL(528,300),"DATA RESET",1,1
13410 WHILE MOUSE(2,0)=0 AND MOUSE(2,1)=0:WEND
13420 MX=MOUSE(0):MY=MOUSE(1):F=0
13430 IF MOUSE(2,1) WHILE MOUSE(2,1):WEND:PUT@A(528,70)-(639,405),MAP1&:GOTO 12860
13440 IF MX>528 AND MY>85 AND MY<101 GOSUB *C_UNITDATA_MOVE
13450 IF MX>528 AND MY>101 AND MY<118 GOSUB *C_UNITDATA_LEFT
13460 IF MX>528 AND MY>117 AND MY<134 GOSUB *C_UNITDATA_FUEL
13470 IF MX>528 AND MY>299 AND MY<316 GOSUB *C_UNITDATA_RESET
13480 IF MX>528 AND MY>149 AND MY<166 Y=1:GOSUB *C_UNITDATA_WEAPON
13490 IF MX>528 AND MY>181 AND MY<198 Y=2:GOSUB *C_UNITDATA_WEAPON
13500 IF MX>528 AND MY>213 AND MY<230 Y=3:GOSUB *C_UNITDATA_WEAPON
13510 CLS 4:IF F=1 F=0:GOTO 13300
13520 GOTO 13410
13530 *C_UNITDATA_MOVE
13540 LOCATE 66,20:LINE INPUT "Move:";A$:IF A$="" RETURN
13550 IF VAL(A$)<0 OR VAL(A$)>255 RETURN
13560 MID$(CAMP_UNIT$(NO1),10,1)=CHR$(VAL(A$)):F=1
13570 RETURN
13580 *C_UNITDATA_LEFT
13590 LOCATE 66,20:LINE INPUT "Left:";A$:IF A$="" RETURN
13600 IF VAL(A$)<0 OR VAL(A$)>255 RETURN
13610 MID$(CAMP_UNIT$(NO1),4,1)=CHR$(VAL(A$)):F=1
13620 RETURN
13630 *C_UNITDATA_FUEL
13640 LOCATE 66,20:LINE INPUT "Fuel:";A$:IF A$="" RETURN
13650 IF VAL(A$)<0 OR VAL(A$)>255 RETURN
13660 MID$(CAMP_UNIT$(NO1),5,1)=CHR$(VAL(A$)):F=1
13670 RETURN
13680 *C_UNITDATA_WEAPON
13690 LOCATE 66,20:LINE INPUT "Weapon Left:";A$:IF A$="" RETURN
13700 IF VAL(A$)<0 OR VAL(A$)>255 RETURN
13710 MID$(CAMP_UNIT$(NO1),11+Y,1)=CHR$(VAL(A$)):F=1
13720 RETURN
13730 *C_UNITDATA_RESET
13740 CAMP_UNIT$(NO1)=FNUNIT_DATA$(NO1,1,3)+CHR$(10,UNITDATA(NO2,0))+FNUNIT_DATA$(NO1,6,4)+CHR$(UNITDATA(NO2,1))+FNUNIT_DATA$(NO1,11,1)+FNUNIT_DATA$(NO1,12,4)+FNUNIT_DATA$(NO1,16,17):F=1
13750 RETURN
13760 *PUT_UNIT '------------------------------------------------- PUT_UNIT
13770 NO1=(CAMP-1)*48
13780 IF FNUNIT_NO1(NO1)=254 GOTO *PUT_UNIT1 ELSE NO1=NO1+1:IF NO1=CAMP*48 ELSE 13780
13790 SYMBOL(16,448),"ユニットが既に48在ります",1,1
13800 WHILE MOUSE(2,0):WEND
13810 LINE(16,448)-(300,463),PSET,0,BF
13820 GOTO 12860
13830 *PUT_UNIT1
13840 X1=HEX_X+X:Y1=HEX_Y+Y
13850 CAMP_UNIT$(NO1)=FNUNIT_DATA$(NO1,1,2)+CHR$(UNIT_NO+1,10,UNITDATA(NO2,0))+FNUNIT_DATA$(NO1,6,4)+CHR$(UNITDATA(NO2,1))+FNUNIT_DATA$(NO1,11,1)+FNUNIT_DATA$(NO1,12,4)+FNUNIT_DATA$(NO1,16,17)
13860 MID$(MAP_DATA$(Y1),X1*2+2,1)=CHR$(NO1+(CAMP-1)*16)
13870 ON HEX_MODE+1 GOTO *P_U_0,*P_U_1,*P_U_2
13880 *P_U_0
13890 SX=X*32+(Y MOD 2)*16:SY=Y*24
13900 A$=UNITNAME$(FNUNIT_NO(X1,Y1)):I=INSTR(A$," ")
13910 COLOR ,%10:SYMBOL(SX,SY+16),A$,1/(-3*(I=0)-2*(I>9)-(I>5)+1),.5!,%(FNUNIT_TMP(X1,Y1)\64)+1,,,8:COLOR ,%0
13920 SYMBOL(SX+8,SY+8),STR$(FNUNIT_LEFT(X1,Y1)),1,.5!,%10,,,8
13930 GOTO *P_U_NEXT
13940 *P_U_1
13950 SX=X*16+(Y MOD 2)*8:SY=Y*12
13960 SYMBOL(SX,SY+8),STR$(FNUNIT_LEFT(X1,Y1)),.5!,.5!,%(FNUNIT_TMP(X1,Y1)\64)+1,,,8
13970 GOTO *P_U_NEXT
13980 *P_U_2
13990 SX=X*8+(Y MOD 2)*4:SY=Y*6
14000 I=25+CAMP:PUT@A(SX,SY)-(SX+7,SY+5),HQ&,MATTE,,,0,6*I
14010 *P_U_NEXT
14020 GOTO 12860
14030 *SELECT_HEX_U_2 '------------------------------------- SELECT_HEX_U_2
14040 X1=HEX_X+X:Y1=HEX_Y+Y
14050 IF FNUNIT_TMP(X1,Y1)=254 GOTO 12860
14060 CAMP_UNIT$(NO1)=CHR$(0,0,&HFF,0,0,0,0,0,0,0,0,0,0,0,&HFF)+STRING$(17,CHR$(0))
14070 MID$(MAP_DATA$(Y1),X1*2+2,1)=CHR$(&HFF)
14080 ON HEX_MODE+1 GOTO *S_H_0,*S_H_1,*S_H_2
14090 *S_H_0
14100 SX=X*32+(Y MOD 2)*16:SY=Y*24
14110 PUT@A(SX,SY)-(SX+31,SY+31),LAND&,MATTE,,,0,128*FNMAP(X1,Y1)
14120 GOTO *S_H_NEXT
14130 *S_H_1
14140 SX=X*16+(Y MOD 2)*8:SY=Y*12
14150 PUT@A(SX,SY)-(SX+31,SY+31),LAND&,MATTE,.5!,.5!,0,128*FNMAP(X1,Y1)
14160 GOTO *S_H_NEXT
14170 *S_H_2
14180 SX=X*8+(Y MOD 2)*4:SY=Y*6
14190 I=FNMAP(X,Y):PUT@A(SX,SY)-(SX+7,SY+5),HQ&,MATTE,,,0,6*I
14200 *S_H_NEXT
14210 GOTO 12860
14220 *CLEAR_U '--------------------------------------------------- CLEAR_U
14230 SYMBOL(42*8,464),"CLEAR",1,1,%1
14240 FOR Y=0 TO 63
14250 FOR X=0 TO 63
14260 MID$(MAP_DATA$(Y),X*2+2,1)=CHR$(&HFF)
14270 NEXT
14280 NEXT
14290 FOR I=0 TO 48*4-1
14300 CAMP_UNIT$(I)=CHR$(0,0,&HFF,0,0,0,0,0,0,0,0,0,0,0,&HFF)+STRING$(17,CHR$(0))
14310 NEXT
14320 GOSUB *PRINT_HEX
14330 SYMBOL(42*8,464),"CLEAR",1,1,%10
14340 GOTO 12860
14350 *PRINT_HEX '----------------------------------------------- PRINT_HEX
14360 ON HEX_MODE+1 GOTO *HEX_MODE_0,*HEX_MODE_1,*HEX_MODE_2
14370 *HEX_MODE_0:HEX_SX=32:HEX_SY=24:HEX_MX=15:HEX_MY=17
14380 FOR Y=0 TO 17
14390 SY=Y*24:Y1=HEX_Y+Y
14400 FOR X=0 TO 15
14410 SX=X*32+(Y MOD 2)*16:X1=HEX_X+X
14420 PUT@A(SX,SY)-(SX+31,SY+31),LAND&,MATTE,,,0,128*FNMAP(X1,Y1)
14430 IF FNUNIT_TMP(X1,Y1)<>255 A$=UNITNAME$(FNUNIT_NO(X1,Y1)):I=INSTR(A$," "):COLOR ,%10:SYMBOL(SX,SY+16),A$,1/(-3*(I=0)-2*(I>9)-(I>5)+1),.5!,%(FNUNIT_TMP(X1,Y1)\64)+1,,,8:COLOR ,%0:SYMBOL(SX+8,SY+8),STR$(FNUNIT_LEFT(X1,Y1)),1,.5!,%10,,,8
14440 NEXT
14450 NEXT
14460 LINE(574+HEX_X,HEX_Y)-STEP(18,20),XOR,%10,B
14470 RETURN
14480 *HEX_MODE_1:HEX_SX=16:HEX_SY=12:HEX_MX=31:HEX_MY=35
14490 FOR Y=0 TO 35
14500 SY=Y*12:Y1=HEX_Y+Y
14510 FOR X=0 TO 31
14520 SX=X*16+(Y MOD 2)*8
14530 PUT@A(SX,SY)-(SX+31,SY+31),LAND&,MATTE,.5!,.5!,0,128*FNMAP(HEX_X+X,Y1)
14540 IF FNUNIT_TMP(HEX_X+X,Y1)<>255 SYMBOL(SX,SY+8),STR$(FNUNIT_LEFT(HEX_X+X,Y1)),.5!,.5!,%(FNUNIT_TMP(HEX_X+X,Y1)\64)+1,,,8
14550 NEXT
14560 NEXT
14570 LINE(574+HEX_X,HEX_Y)-STEP(34,38),XOR,%10,B
14580 RETURN
14590 *HEX_MODE_2:HEX_SX=8:HEX_SY=6:HEX_MX=63:HEX_MY=63:HEX_X=0:HEX_Y=0
14600 FOR Y=0 TO 63
14610 SY=Y*6
14620 FOR X=0 TO 63
14630 SX=X*8+(Y MOD 2)*4
14640 IF FNUNIT_TMP(X,Y)=255 I=FNMAP(X,Y) ELSE I=25+(FNUNIT_TMP(X,Y)\64)
14650 PUT@A(SX,SY)-(SX+7,SY+5),HQ&,MATTE,,,0,6*I
14660 NEXT
14670 NEXT
14680 RETURN
14690 *PRINT_HEX_ALL
14700 FOR Y=0 TO 63
14710 FOR X=0 TO 63
14720 PSET(575+X,1+Y),%MAP_COLOR(FNMAP(X,Y))
14730 NEXT
14740 NEXT
14750 LINE(574,0)-(639,65),PSET,%10,B
14760 RETURN
14770 *PRINT_SELECTION '----------------------------------- PRINT_SELECTION
14780 IF EDIT_MODE=1 THEN *UNIT_
14790 *HEX_
14800 LINE(528,70)-(639,405),PSET,%0,BF
14810 FOR Y=0 TO 8
14820 FOR X=0 TO 2
14830 SX=543+X*32:SY=70+Y*32
14840 IF X+Y*3<26 PUT@A(SX,SY)-(SX+31,SY+31),LAND&,,,,,128*(X+Y*3)
14850 NEXT
14860 NEXT
14870 SYMBOL(543,358),"Hex",1,1,%10
14880 PUT@A(543,374)-(574,405),LAND&,,,,,128*HEX_NO
14890 RETURN
14900 *UNIT_
14910 LINE(528,70)-(639,405),PSET,%0,BF
14920 SYMBOL(559,85),"△",1,1,%10:SYMBOL(559,357),"▽",1,1,%10
14930 FOR I=0 TO 31
14940 IF UNIT_S+I>125 THEN 14960
14950 SYMBOL(528,101+I*8),UNITNAME$(UNIT_S+I),.5!,.5!,%10
14960 NEXT
14970 SYMBOL(528,374),"Unit",1,1,%10
14980 COLOR,%14:SYMBOL(528,390),UNITNAME$(UNIT_NO),.5!,1,%CAMP,,,8:COLOR,%0
14990 RETURN
15000 *PALETTE '--------------------------------------------------- PALETTE
15010 PALETTE 0,[ 0, 0, 0]:PALETTE 1,[ 0, 0,192]
15020 PALETTE 2,[ 0,192, 0]:PALETTE 3,[192, 0, 0]
15030 PALETTE 4,[192,192, 0]:PALETTE 5,[ 0,128, 0]
15040 PALETTE 6,[128,192, 0]:PALETTE 7,[255, 0, 0]
15050 PALETTE 8,[255,255, 0]:PALETTE 9,[255, 0,255]
15060 PALETTE 10,[255,255,255]:PALETTE 11,[ 0, 0, 0]
15070 PALETTE 12,[ 0,128,192]:PALETTE 13,[ 64, 64, 64]
15080 PALETTE 14,[128,128,128]:PALETTE 15,[128,128, 0]
15090 MAP_COLOR( 0)= 6:MAP_COLOR( 1)= 7:MAP_COLOR( 2)= 3:MAP_COLOR( 3)= 9
15100 MAP_COLOR( 4)= 1:MAP_COLOR( 5)= 8:MAP_COLOR( 6)= 4:MAP_COLOR( 7)= 5
15110 MAP_COLOR( 8)= 6:MAP_COLOR( 9)=12:MAP_COLOR(10)=14:MAP_COLOR(11)=10
15120 MAP_COLOR(12)=10:MAP_COLOR(13)=10:MAP_COLOR(14)=10:MAP_COLOR(15)=10
15130 MAP_COLOR(16)=10:MAP_COLOR(17)=10:MAP_COLOR(18)=10:MAP_COLOR(19)=10
15140 MAP_COLOR(20)=10:MAP_COLOR(21)=10:MAP_COLOR(22)=10:MAP_COLOR(23)=10
15150 MAP_COLOR(24)=10:MAP_COLOR(25)=10
15160 RETURN
15170 *LOAD_DATA '----------------------------------------------- LOAD_DATA
15180 LOAD@ "A:\LAND.DAT",LAND&
15190 LOAD@ "A:\HQ.DAT",HQ&
15200 LOAD@ "A:\MAPUNIT.DAT",MAPUNIT&
15210 OPEN "A:\PARAM.DAT" FOR INPUT AS #1
15220 A$=INPUT$(200,1):A$=INPUT$(238,1)
15230 FOR I=0 TO 15
15240 ARM_NAME$(I)=INPUT$(14,1):A$=INPUT$(4,1)
15250 NEXT
15260 CLOSE
15270 OPEN "A:\UNITV.DAT" FOR INPUT AS #1
15280 A$=INPUT$(250,1):A$=INPUT$(250,1):A$=INPUT$(250,1):A$=INPUT$(250,1)
15290 A$=INPUT$(46,1)
15300 FOR I=0 TO 125
15310 UNITNAME$(I)=INPUT$(18,#1):A$=INPUT$(62,#1)
15320 UNITDATA(I, 0)=ASC(MID$(A$, 2,1)) 'FUEL
15330 UNITDATA(I, 1)=ASC(MID$(A$, 5,1)) 'MOVE
15340 UNITDATA(I, 8)=ASC(MID$(A$,17,1)) 'WEAPON LEFT
15350 UNITDATA(I, 9)=ASC(MID$(A$,18,1)) 'WEAPON LEFT
15360 UNITDATA(I,10)=ASC(MID$(A$,19,1)) 'WEAPON LEFT
15370 UNITDATA(I,11)=ASC(MID$(A$,20,1)) 'WEAPON LEFT
15380 UNITDATA(I,12)=ASC(MID$(A$,21,1)) 'WEAPON LEFT
15390 UNITDATA(I,13)=ASC(MID$(A$,22,1)) 'WEAPON LEFT
15400 UNITDATA(I, 2)=ASC(MID$(A$,11,1)) 'WEAPON NO
15410 UNITDATA(I, 3)=ASC(MID$(A$,12,1)) 'WEAPON NO
15420 UNITDATA(I, 4)=ASC(MID$(A$,13,1)) 'WEAPON NO
15430 UNITDATA(I, 5)=ASC(MID$(A$,14,1)) 'WEAPON NO
15440 UNITDATA(I, 6)=ASC(MID$(A$,15,1)) 'WEAPON NO
15450 UNITDATA(I, 7)=ASC(MID$(A$,16,1)) 'WEAPON NO
15460 NEXT:CLOSE
15470 RETURN
15480 *LOAD_MAP '------------------------------------------------- LOAD_MAP
15490 OPEN "A:\"+FILE$ FOR INPUT AS #1
15500 DUMMY$=INPUT$(6,1)
15510 FOR I=0 TO 63
15520 MAP_DATA$(I)=INPUT$(128,1)
15530 NEXT
15540 MAP_SITUATION$=INPUT$(128,1)
15550 FOR I=0 TO 3
15560 CAMP$(I)=INPUT$(64,1)
15570 NEXT
15580 FOR I=0 TO 4*48-1
15590 CAMP_UNIT$(I)=INPUT$(32,1)
15600 NEXT
15610 FOR I=0 TO 3
15620 PRODUCTION$(I)=INPUT$(52,1)
15630 NEXT:CLOSE
15640 RETURN
15650 *SET_HEX_DATA '----------------------------------------- SET_HEX_DATA
15660 LINE(0,0)-(31,31),PSET,%0,BF
15670 FOR Y=0 TO 31
15680 FOR X=0 TO 31
15690 IF MASK(X,Y)=0 PSET(X,Y),%1
15700 NEXT
15710 NEXT
15720 GET@A(0,0)-(31,31),MASK&
15730 FOR I=0 TO 24
15740 PUT@A(0,0)-(31,31),LAND&,,,,,128*I
15750 PUT@A(0,0)-(31,31),MASK&,MATTE,,,%1
15760 GET@A(0,0)-(31,31),LAND&,128*I
15770 NEXT
15780 RETURN
15790 *MASK '--------------------------------------------------------- MASK
15800 FOR Y=0 TO 31
15810 READ A$
15820 FOR X=0 TO 7
15830 B=VAL("&H"+MID$(A$,X+1,1))
15840 IF B>7 MASK(X*4 ,Y)=1:B=B-8
15850 IF B>3 MASK(X*4+1,Y)=1:B=B-4
15860 IF B>1 MASK(X*4+2,Y)=1:B=B-2
15870 IF B>0 MASK(X*4+3,Y)=1:B=B-1
15880 NEXT
15890 NEXT:RETURN
15900 DATA FFFE7FFF,FFF81FFF,FFE007FF,FF8001FF,FE00007F,F800001F,E0000007
15910 DATA 80000001,00000000,00000000,00000000,00000000,00000000,00000000
15920 DATA 00000000,00000000,00000000,00000000,00000000,00000000,00000000
15930 DATA 00000000,00000000,00000000,80000001,E0000007,F800001F,FE00007F
15940 DATA FF8001FF,FFE007FF,FFF81FFF,FFFE7FFF
15950 *LOAD '--------------------------------------------------------- LOAD
15960 FOR I=0 TO 15:PALETTE I,[0,0,0]:NEXT
15970 FILES "A:\*.MAP"
15975 FILES "A:\*.GDT"
15980 INPUT "FILE NAME:",FILE$:GOSUB *LOAD_MAP
15990 RETURN
16000 *SAVE '--------------------------------------------------------- SAVE
16010 SYMBOL(13*8,464),"SAVE",1,1,%1
16020 KILL "A:\"+FILE$
16030 OPEN "A:\"+FILE$ FOR OUTPUT AS #1
16040 PRINT #1,DUMMY$;
16050 FOR I=0 TO 63
16060 PRINT #1,MAP_DATA$(I);
16070 NEXT
16080 PRINT #1,MAP_SITUATION$;
16090 FOR I=0 TO 3
16100 PRINT #1,CAMP$(I);
16110 NEXT
16120 FOR I=0 TO 4*48-1
16130 PRINT #1,CAMP_UNIT$(I);
16140 NEXT
16150 FOR I=0 TO 3
16160 PRINT #1,PRODUCTION$(I);
16170 NEXT:CLOSE
16180 SYMBOL(13*8,464),"SAVE",1,1,%10
16190 RETURN
16200 *ERR
16210 RESUME NEXT